package de.tabuma.sso.attribute;

import de.tabuma.sso.logik.*;
import de.tabuma.lib.contentmanagement.*;
import java.util.*;

/**
 * @author $Author: $
 * @version $Revision: $
 * @since $Date: $
 */
public class AttributeFacade {

    public static int create(Attribute attribute, String user) {
        return (int) PMF.doCreate(attribute, user);
    }

    public static void update(Attribute attribute, String user) {
        PMF.doUpdate(attribute, user);
    }



    public static Attribute get(int id) {
        return PMF.get(id, new Attribute());
    }

    public static void remove(int id, String user) {
        Attribute attribute = get(id);
        PMF.doRemove(attribute, user);
    }

    public static List<Attribute> getList(int userId) {
        String keys[] = {"userId"};
        String values[] = {""+userId};
        return PMF.get(keys, values, new Attribute());
    }
}
